home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
kcl
/
akcl
/
akcl1615.lha
/
xbin
/
strip-ifdef
< prev
next >
Wrap
Text File
|
1990-01-15
|
364b
|
11 lines
#!/bin/sh
# Sample usage strip-ifdef foo.c -Dmips -DATT
# will select only code in those ifdefs which are selected by mips and ATT.
# includes, and defines will be left intact, as will comments
cat $1 | sed -e "s:^#include:XX#include:g" -e "s:^#define:XX#define:g" > /tmp/tmpx.c
shift 1
gcc -E -C /tmp/tmpx.c $@ | sed -e "/^#/d" -e "s:XX#:#:g" -e "/^$/d" | cb